home *** CD-ROM | disk | FTP | other *** search
- Commands covered in this section:
- ED
- MAKEDIR
- COPY
- DIR
- RENAME
- RELABEL
-
- ________________________________________________________________________________
-
- ED
-
- ED is the text editor found in the C: directory on the WB disk.
- Your best bet is to get one of the reference books on AmigaDOS for the complete
- listing of commands, but I'll cover the basics here.
- Typing in ED FILENAME will either allow you to edit an existing file
- or, if the file doesn't exist, it will create a new one.
-
- >> CD ram: /* ED writes to the current directory */
- >> ED foo
-
- Now just type in a few lines of whatever you feel like seeing. It
- doesn't matter and should neither be too long nor too important because this
- will ultimately be thrown away. This IS just a tutorial, I don't have time
- to wait for you to write the Great American Novel! But about 10-12 lines would
- be nice.
-
- The way ED works is it's a limited word processer in it's normal mode.
- But by hitting the <ESC> key it enters what's known as the extended command
- mode. This mode allows you to set blocks, write that block to another file,
- delete it, quit WITHOUT SAVING any changes, quit SAVING your changes, etc, etc.
-
- Some of the major EXTENDED commands you'll need to know are:
- Q quits and DOESN'T SAVE
- X quits and saves work
- T goes to top of file
- BS block start
- BE block end
- B goes to bottom of file
- WB/filename/ writes to that file
- DB deletes a pre-defined block
- All followed by a <RETURN>
-
- There are a lot more! And they can be joined together by using a
- semicolon ";".
-
- Now go back to the ED window and type in an <ESC>. What should have
- happened is that the cursor went from where ever it was to the bottom of the
- window and an asterisk "*" should have appeared. You're now in the extended
- command mode.
- Hit <RETURN>.
- The cursor went back to where it was and you're back in normal mode.
-
- Now move the cursor to the start of the second line of text and press
- <ESC>.
- Now (be ready to watch what goes on when you hit <RETURN>) type:
-
- * be;t;bs;wb/foo_2/<RETURN>
-
- What happened was that it marked the bottom of a block /* be */, went
- to the top of the file /* t */, marked the top of a block /* bs */, and wrote
- a copy of that block to a file named "foo_2" in the current directory /* wb// */
-
- OK? You should have the cursor on the line at the bottom of the block
- you marked.
-
- Hit <ESC>
-
- * be;t;bs;db <RETURN>
-
- This time it marked the same block but it deleted it.
-
- Hit <ESC>
-
- * x <RETURN>
-
- If you'd have had a long enough file you would have seen the line
- "Writing to file" at the bottom of the screen as it exited.
-
- >> DIR
- foo
- foo_2
-
- Right?
-
- So there's a start at editing text files.
-
-
- ________________________________________________________________________________
-
- MAKEDIR
-
- creates new directories.
-
- >> CD
- ram:
- >> MAKEDIR foo_stuff
- >> DIR
- foo_stuff (dir)
- foo
- foo_2
-
- Pretty easy, eh? This works with any valid PATHNAME, IF that directory
- doesn't already exist!
-
- ________________________________________________________________________________
-
- COPY
-
- copies files from one place to another
-
- >> COPY foo foo_stuff
- >> DIR foo_stuff
- foo
-
- It will also rename things in the process of coping if you give it
- the new name as part of the destination.
-
- >> COPY foo foo_stuff/foo_3
- >> DIR foo_stuff
- foo
- foo_3
- >> TYPE foo
- >> TYPE foo_3
-
- The lines that appeared on the screen after both TYPE commands should
- have been the same.
-
- You can use two other options with copy. These act as switches and
- are ALL and QUIET. The ALL switch will copy an entire directory:
-
- >> COPY df0:s ram: ALL
-
- The QUIET command prevents the command from printing the list to the
- screen as it's performing its tasks.
-
- ________________________________________________________________________________
-
- RENAME
-
- renames files
- This WON'T JUST change from lower to uppercase /* or vice versa */.
- For instance, it wouldn't change "foo" to "Foo" since the CLI is not case
- sensitive. It would view both those names as identical, but "foo" and "foo."
- are totally different names as far as the DOS is concerned, so once again,
- SPELLING IS IMPORTANT!!!
-
- Now try:
- >> RENAME foo_stuff/foo_3 foo_3 /* think it will change this name? */
- >> DIR foo_stuff
- foo
- >> DIR /* I am assuming you're still CDed to RAM:, if your not or aren't sure
- check */
- foo_stuff (dir)
- foo
- foo_2
- foo_3
-
- See what it did? Since I didn't give it the same PATHNAME, it moved
- foo_3 from the foo_stuff directory to the root directory. This is a common
- mistake, so if you rename something and it seems to get lost..check to be sure
- you didn't make this mistake.
-
- Another limitation, RENAME won't work across drives. It's not COPY, so
- you CAN'T do something like:
- RENAME df1:foo df2:fum
-
- _______________________________________________________________________________
-
- RELABEL
-
- a "rename" but for disks
-
- The format for making the standard WB:c/RELABEL work is:
-
- RELABEL DRIVE df?: NAME whatever
-
-
- ________________________________________________________________________________
-
- DIR
-
- tells you what is in a directory
-
- We've been using DIR alot so far and that's as it should be. If not
- critical, it's good to be able to track down information. Over and above the
- simple looking around we've been doing, there are a few options one can use
- with this command:
-
- OPT A and OPT I
-
- >> DIR df0:
- c (dir)
- l (dir)
- devs (dir)
- s (dir)
- T (dir)
- fonts (dir)
- libs (dir)
- Examples (dir)
- Film (dir)
- .info CLI_tutorial.1
- CLI_tutorial.2 CLI_tutorial.3
- CLI_tutorial.4 CLI_tutorial.5
- CLI_tutorial.6 CLI_tutorial.intro
- Disk.info Only.info
- WB_axe
-
- That's good, but let's say you put a file on the disk, in a directory
- a while ago and you don't remember EXACTLY where it is.
- You could go right down the line and DIR each directory individually
- or you can use OPT A.
-
- >> DIR df0: OPT A
- /* I'm not going to waste the time or space to list everything that's going
- to appear, but you should be just about convinced that all the files on df0:
- have been listed. */
-
- OPT A goes into all the subdirectories it finds from where ever you
- start.
-
- >> DIR devs: OPT A
- /* once again, I'm not going to list everything, but compare for yourself
- if you're sceptical */
- It will have started with df0:devs and gone to the bottom of that
- directory, but no higher.
-
- What's that? You say you'd have liked to compare the results but
- they keep scrolling off the top. OK, we'll use "redirection" again.
-
- >> DIR >ram:df0_list df0: OPT A
-
- Now you won't get a list to the screen, but the drive light still
- comes on and it appears that the system's doing something. So when the prompt
- comes back...
-
- >> DIR ram:
- /* all the "foo" stuff should still be here, as well as */
- df0_list
-
- >> CD
- RAM: /* still */
- >> TYPE df0_list
- /* Now you'll get all the same information you got before, but with no more
- disk activity. Magic, you say? */
-
- Now OPT I...
-
- First a word of caution, the "I" is for interactive and since it is,
- it can be used to delete things.
-
- What will happen is that the system will display the first entry in
- the directory with a "?" after it. Assuming that it ISN'T a directory which
- is handled a little differently, the responses it will accept are:
- <RETURN> which tells DOS to leave it alone
- T which means you want it TYPEd /* not for binaries */
- Q quit
- <CTRL>C if you "T" a file, this causes it to stop and go back
- to the interactive mode
- or
- "D""E""L" delete /* the three letters, not the <DEL> key */
-
- For directories:
- E to enter it
- B to back up to the next higher level, but no higher than
- the initial entry level
-
- Directories can also be deleted as noted above, but only if they're
- empty.
-
- >> CD
- RAM: /* if not ">> CD ram:" !!! */
- >> DIR OPT I
- /* Since I'm trying to do this at all the opportunities that I get, I'm not
- reconstructing all the ram: based files. This is only a problem in that I
- can't tell you exactly which one will come up first. But by typing in the
- above commands, you can see how it works. One other thing, since we're
- going to be getting to the DELETE command next, don't delete the directory
- in your new found power. */
-
- You should be able to imagine how this option would come in handy
- for quick basic house cleaning; it doesn't require knowing exact PATHNAMES
- and it can do a whole disk if you so desire.
-
-
-
- ________________________________________________________________________________
-
- DELETE
-
- throws away all the junk that seems to get on your disks
- without your knowing how
-
- Since you've been in ram: messing around with DIR OPT I, at this stage
- I'm not sure what you might have left, we'll use a little directory I've
- slipped in on you.
-
- The way you throw stuff away is:
- DELETE PATHNAME/FILENAME
-
- Try it out on whatever you might have left in ram: /* you're still
- CDed there aren't you */, but once again, leave the foo_stuff directory,
- we'll get to it in a minute.
-
- >> DIR
- /* now type DELETE and the name of any file you find */
- >> DELETE ________
- >> DIR
- /* you should have one less file there now than before */
-
- Go ahead and delete all the FILES in the list you got at the DIR
- command.
-
- DELETE will also do entire directories in much the same way that
- COPY does. Both the ALL and the QUIET switches can be used.
- If you haven't turned your machine off since you started this
- example, there should be two directories in ram: now: foo_stuff and s.
-
- >> DIR foo_stuff
- /* the listing of what's in there */
- >> DELETE foo_stuff ALL
- /* a listing of all the files as they're deleted, ending with an entry telling
- you that foo_stuff was deleted too */
- >> DIR s
- startup-sequence
- >> DELETE s ALL QUIET
- >>
- >> DIR
- /* ram: should be empty at this time */
-
- ________________________________________________________________________________
-
- This will do it for the second file, go on to CLI_Tutorial.3
- whenever you're ready.
-